Improve auto-paint reliability and 3MF exports#41
Open
vycdev wants to merge 32 commits into
Open
Conversation
Add auto-paint detail controls and optimizer tiers Replace the repeated-swaps toggle with an Off/2/4/6/8/12 selector and add a transition-detail selector (80/90/95% opacity) so stack height vs color resolution is an explicit trade-off. Expand the optimizer menu to five effort tiers (Fast/Balanced/Thorough/Deep/Exact base order) and score sequences against the already-processed palette with an added detail- coverage term. Polish the panel UI: a determinate progress bar, fixed-width label column so controls align, a quality/speed meter under the algorithm picker, and nesting the enhanced-matching sub-options under their gate toggle. @
Replace the repeated-swaps toggle with an Off/2/4/6/8/12 selector and add a transition-detail selector (80/90/95% opacity) so stack height vs color resolution is an explicit trade-off. Expand the optimizer menu to five effort tiers (Fast/Balanced/Thorough/Deep/Exact base order) and score sequences against the already-processed palette with an added detail- coverage term. Polish the panel UI: a determinate progress bar, fixed-width label column so controls align, a quality/speed meter under the algorithm picker, and nesting the enhanced-matching sub-options under their gate toggle.
…omacut into autopaint-improvements
Diffuse height-quantization error with the 12-neighbor, error-conserving Stucki kernel instead of Floyd-Steinberg, spreading error over a wider area for smoother tonal gradients and fewer directional artifacts. Block-aware dot sizing, serpentine scan, and edge protection are unchanged.
The optimizer scored each image color by projecting onto the raw per-layer Lab polyline, which could land a target on a one-layer transition sliver -- a color no pixel is ever assigned -- and then optimize that fiction (e.g. treating a purple target as rendering blue). Collapse consecutive same-color layers into flat-zone nodes the way the 3D preview does, so the objective scores the colors the model actually builds. All goldens and realized-error budgets pass unchanged.
Assign each distinct image color to a distinct printable color so perceptibly different colors are never collapsed onto one flat surface, keeping gradient variation at a small per-color accuracy cost. The injective, weight-ordered assignment runs in the shared printable-color mapper used by both the optimizer score and the 3D preview, so the optimized order and the built model stay consistent. Opt-in toggle under Enhanced color matching, off by default; existing behavior, goldens, and quality budgets are unchanged.
Contributor
|
Hey, I tried this PR, and it looks good- I couldn't find any bugs off the bat, the new coloring is a big improvement, and claude code thinks it's good. If you want to merge this, I'll fix up multi-head to work with it. that said, I have not looked at the code, if you would like a review I'm happy to do one. |
- Add createCenterWeight/createEdgeWeight factories that hoist all size-dependent terms once, and have useSwatches build them per image so the per-pixel swatch scan no longer recomputes exp/hypot per pixel. - Use the least-opaque calibrated channel TD for the foundation layer so all channels reach ~95% opacity when the base filament is calibrated. - Drop the production-dead generate*WeightedMapSimple helpers and retarget the region-weight test at the new factories.
The TD fit derives transmission from each measurement's RGB via the
linear-light blend inverse, so the stored measurement.transmission field
was written (by the legacy pure-ratio rgbToTransmission model) but never
read. The validation it fed could never fail because rgbToTransmission
clamps its own output to [0,1].
Collapse to one transmission model:
- Remove the transmission field from CalibrationMeasurement.
- Remove rgbToTransmission and normalizeCalibrationMeasurements.
- Drop the can't-fail transmission bounds check from validateMeasurement.
- importCalibration now strips measurements to {layers, rgb}, dropping the
legacy key from older exports.
No behavior or UI change: the field never affected the fit and was not
displayed. Old profiles still load.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileReaderand string-size failures.Why
Auto-paint choices now match the physical stack Kromacut previews and exports, which makes optimizer results more reproducible and less surprising under Max Height, calibration, and repeated-swap settings. The updated controls expose the quality/runtime tradeoffs more directly while preventing conflicting height-map modes.
Large 3MF exports also avoid browser/WebView memory failure paths that could break desktop saves.
Validation
npm test(212 passing)npm run lintnpm run buildgit diff --check